from dataclasses import dataclass, field
from datetime import datetime
from typing import Optional


@dataclass
class NewsDTO:
    id: Optional[int] = None
    title: str = ""
    content: str = ""
    category: str = ""
    status: int = 0
    author: Optional[str] = None
    created_at: Optional[datetime] = None
    updated_at: Optional[datetime] = None
    # 不再继承BaseDTO，而是直接包含所有需要的字段


@dataclass
class NewsListDTO:
    items: list[NewsDTO] = field(default_factory=list)
    total: int = 0
    page: int = 1
    page_size: int = 10
